package com.lizemin.clients;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author lzm
 * @date 2025/4/19 21:27
 * @description
 */
@FeignClient(name = "STOCK-SERVICE")
public interface StockClient {

    /**
     * 扣减库存
     * @param productId 商品id
     * @param count 购买数量
     * @return  成功：success，失败：error
     */
    @PutMapping("/deductStock")
    String deductStock(@RequestParam("productId") Integer productId, @RequestParam("count") Integer count);

}
